function func(obj) {
  const newObj = Object.assign({}, obj)
  newObj.name = '浅拷贝？'
  console.log(newObj)
}
const obj1 = { name: '深拷贝！' }

func(obj1)
console.log(obj1)

// 正常函数可以修改内部的属性
function func2(obj) {
  obj.name = 'func obj2'
  console.log(obj)
}
const obj2 = { name: 'global obj2' }

func2(obj2)
console.log(obj2)
// { name: 'func obj2' }
// { name: 'func obj2' }
